<?php
	session_start();
        include_once(dirname(__FILE__). "/../../core/managers/business/class.user.php");
	include_once(dirname(__FILE__). "/../../core/presenters/administration/taxonAdministration/class.taxonAdministration_Presenter.php");

        $user_connected = unserialize($_SESSION["current_user"]);
        if(!isset($user_connected) || $user_connected == ""){
            //header('index.php');
            echo "<script language='JavaScript'> window.location = '../../home.php'; </script>";
        }
        $pres = new TaxonAdministration_Presenter($user_connected->getId());

        if(((!isset($user_connected) || $user_connected == "")|| $user_connected->getAdmin() == 0) && (! $pres->getIfUserIsOrderAdmin($user_connected->getId()))){
            //header('index.php');
            echo "<script language='JavaScript'> window.location = '../../home.php'; </script>";
        }else{
            $_SESSION['tax_adm_pres'] = serialize($pres);
        }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel="stylesheet" media="screen" href="../../generic/generic.css" />
        <link rel="stylesheet" media="screen" href="admin_taxon.css" />
        <link rel="icon" type="image/png" href="../../content/images/favicon.ico" />

        <!--JQUERY-->
        <script language='JavaScript' src='../../scripts/jquery-ui-1.8.6.custom/js/jquery-1.4.4.min.js'></script>
        <script language='JavaScript' src='../../scripts/jquery-ui-1.8.6.custom/js/jquery-ui-1.8.6.custom.min.js'></script>
        <link rel="stylesheet" media="screen" type="text/css" title="style" href="../../scripts/jquery-ui-1.8.6.custom/css/ui-darkness/jquery-ui-1.8.6.custom.css" />	

        <!--Autres scripts-->
        <script language='JavaScript' src='../../scripts/generic.js'></script>
        <script language='JavaScript' src='../../scripts/menu_manager.js'></script>
        <script language='JavaScript' src='admin_taxon.js'></script>
        <title>
                Identificator - Administration des taxons
        </title>
    </head>
    <body onload="Hour();">
        <img id="image_fond" src="../../content/images/background/fond.png" style="width:99%; height:99%;"/>
        <?php
                include_once(dirname(__FILE__). "/../../generic/top_level2.php");

                $user_picture_dir = "../../".$pres->getUserPictureDirectory();

                if($user_connected->getPhotoProfil() != ""){
                    echo "<input type='hidden' id='photo_profil' value='".$user_picture_dir.$user_connected->getPhotoProfil()."' />";
                }
                else echo "<input type='hidden' id='photo_profil' value='../../content/images/Default_white.png' />";
        ?>
        <script language='JavaScript'>
                InitHeader(document.getElementById('photo_profil').value, "Administration des taxons ...", '... voici les listes des taxons', true);
        </script>
            <div id="content">
            <div id="menu" class="menu">
                <img id="menuImg1" class="menuImg" src="../../content/images/menus/fleche_menu.png" onmouseover="javascript:itemMenuOver(this)" 
                                                                                                    onmouseout="javascript:itemMenuOver(this)" 
                                                                                                    style="cursor:pointer;"
                                                                                                    onclick="javascript:window.location='../../menu.php'"/>

                <img id="menuImg2" class="menuImg" src="../../content/images/menus/fleche_admin.png" onmouseover="javascript:itemMenuOver(this)" 
                                                                                                        onmouseout="javascript:itemMenuOver(this)" 
                                                                                                        style="cursor:pointer;"
                                                                                                        onclick="javascript:window.location='../administration.php'"/>

                <img id="menuImg3" class="menuImg" src="../../content/images/menus/fleche_taxon.png" onmouseover="javascript:itemMenuOver(this)" 
                                                                                                    onmouseout="javascript:itemMenuOver(this)" 
                                                                                                    style="cursor:pointer;"
                                                                                                    onclick="javascript:window.location='admin_taxon.php'"/>
            </div>
            <div id="div_middle" class="div_middle">
                <span id='label_Info' class='label_Info'>

                </span>
                
                <select id="select_ordre" class="select_ordre">
                    <option value='0'>Sélectionnez...</option>
                    <?php
                        foreach($pres->getAllOrder() as $ordre){
                            echo "<option value='".$ordre->getId()."'>".$ordre->getNom()."</option>";
                        }
                    ?>
                </select>
                
                <div id="contenu_taxonomie" class="contenu_taxonomie">
                    
                </div>
                
            </div>
            <span id="label_error" class="label_error"></span>
        </div>
        <?php
            include_once(dirname(__FILE__). "/../../generic/footer_level2.php");
        ?>
    </body>
</html>
